package cn.tedu.m1;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author wy
 * @Date 2021/3/4 9:15
 * @Version 1.0
 */
@Component

public class Consumer {
    //启动一个消费者 从队列接收消息 并传递给这个方法并进行处理
    //消费者自动启动
    @RabbitListener(queues = "helloworld")
    public void receive(String msg){
        System.out.println("收到:  "+msg);
    }

}
